﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;

namespace APIIT_BPEL_Server
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            //Label1.Text = new APIIT_BPEL_Server.Action_Layer.Front_View_Actions().login("MainActivity---2131230724---UserID=cb004229&Password=uparcdra&Submit=Log+In");

            string connectionString = System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
            using (SqlConnection connection = new SqlConnection(connectionString))
            {
                connection.Open();
                using (SqlCommand command = new SqlCommand("INSERT INTO activity_details (action_id,activity_name,action_url,results) VALUES (@actionId,@activityName,@actionUrl,@results)", connection))
                {
                    command.Parameters.Add(new SqlParameter("actionId", TextBox1.Text));
                    command.Parameters.Add(new SqlParameter("activityName", TextBox2.Text));
                    command.Parameters.Add(new SqlParameter("actionUrl", TextBox3.Text));
                    command.Parameters.Add(new SqlParameter("results", TextBox4.Text));
                    command.ExecuteNonQuery();                   
                }
                connection.Close();
            }
        }
    }
}
